package com.webull.information.client.model.parm;

import java.io.Serializable;

public class BaseParam implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -9123705309401123019L;
	private Integer pageIndex;
	private Integer pageSize;

	public Integer getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(Integer pageIndex) {
		this.pageIndex = pageIndex;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getStart() {
		Integer start = 0;
		if (getPageIndex() != null && getPageSize() != null) {
			if (this.getPageIndex() == 0) {
				start = 0;
			} else {
				start = (this.getPageIndex() - 1) * this.getPageSize();
			}
		}
		return start;
	}

	public Integer getEndRow() {
		Integer endRow = 0;
		if (getPageIndex() != null && getPageSize() != null) {
			endRow = getPageSize();
		}
		return endRow;
	}
}
